import {
	request
} from './uni-request.js'

export const authAPI = {
	login: (data) => request({
		url: '/login',
		method: 'POST',
		data,
		auth: false
	}),

	register: (data) => request({
		url: '/register',
		method: 'POST',
		data,
		auth: false
	})
};

export const orderAPI = {
	createOrder: (data) => request({
		url: '/orderInfo/orderInfo',
		method: 'POST',
		data
	})
};

export const addressAPI = {
	getList: (userId) => request({
		url: `/address/address/list?userId=${userId}`,
		method: 'GET'
	}),

	delete: (addressId) => request({
		url: `/address/address/${addressId}`,
		method: 'DELETE'
	})
};

export const userAPI = {
	getProfile: () => request({
		url: '/system/user/profile',
		method: 'GET'
	})
};
